<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: wshj1
  Date: 2024/4/17
  Time: 14:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生信息</title>
    <script>
        function jump(valPag) {
            document.getElementById("currentPage").value = valPag;
            document.forms[0].submit();
        }
        function changPage() {
            document.forms[0].submit();
        }
    </script>
</head>
<body>
<h3 style="color: aqua">欢迎你: <a href="/logout">安全退出</a></h3>
<a href="/student?userRequest=input">添加</a>
<form action="/student" method="post">
    <tr>
        关键字: <input type="text" name="keyword" value="${qo.keyword}">
        年龄: <input type="text" name="minAge" value="${qo.minAge}"> <input type="text" name="maxAge" value="${qo.maxAge}">
        <input type="submit" value="提交">
    </tr>
<table border="1px" cellpadding="10px" cellspacing="0px">
    <tr>
        <th>id</th>
        <th>sid</th>
        <th>sname</th>
        <th>sub_id</th>
        <th>address</th>
        <th>phone</th>
        <th>email</th>
        <th>age</th>
        <th>操作</th>
    </tr>
    <c:forEach var="student" items="${pageResult.data}">
        <tr>
            <td>${student.id}</td>
            <td>${student.sid}</td>
            <td>${student.sname}</td>
            <td>${student.sub_id}</td>
            <td>${student.address}</td>
            <td>${student.phone}</td>
            <td>${student.email}</td>
            <td>${student.age}</td>
            <td>
                <a href="/student?userRequest=delete&id=${student.id}">删除</a>
                <a href="/student?userRequest=input&id=${student.id}">修改</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="9">
            <a href="#" onclick="jump(${1})">首页</a>
            <a href="#" onclick="jump(${pageResult.prevPage})">上一页</a>
            <a href="#" onclick="jump(${pageResult.nextPage})">下一页</a>
            <a href="#" onclick="jump(${pageResult.totalPage})">尾页</a>
            总计[${pageResult.totalCount}] 条数据
            跳转到[ <input type="text" name="currentPage" id="currentPage" onchange="changPage()" value="${pageResult.currentPage}">/${pageResult.totalPage}] 页
            每页显示[ <input type="text" name="pageSize" onchange="changPage()" value="${pageResult.pageSize}">]条数据

<%--            <select name="pageSize">--%>
<%--                <option value="3" onclick="changPage()">3</option>--%>
<%--                <option value="5" onclick="changPage()">5</option>--%>
<%--                <option value="7" onclick="changPage()">7</option>--%>
<%--            </select>--%>
        </td>
    </tr>

</table>
</form>
</body>
</html>



